<?php
include_once("../ClassesControle/Controle.TipoNota.php");
$control = new Controle();
$control->buscarTodas();
if(count($_POST) == 0){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
input.descricao{
	border-top-color: #FFF;
	border-right-color: #FFF;
	border-bottom-color: #FFF;
	border-left-color: #FFF;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	background-color: #FFF;
}
input.desbloquear{
	border-top-color: #09F;
	border-right-color: #09F;
	border-bottom-color: #09F;
	border-left-color: #09F;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	background-color: #FFF;
}
</style>
</head>


<body>
<table width="500" border="0">
  <tr>
    
    <td>Descrição</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
   <?php foreach($control->lista as $tipoNota){ ?>
    
    <td>
    <input lang="<?php echo $tipoNota->getId(); ?>"  class="descricao" 
    disabled="disabled" maxlength="360" type="text" value="<?php echo $tipoNota->getDescricao(); ?>"  />
    </td>
    <td><a href="#" class="editarTipoNota" lang="<?php echo $tipoNota->getId(); ?>"><img src="imagens/editarBasico.png" /></a></td>
    <td><a href="#" class="excluirTipoNota" lang="<?php echo $tipoNota->getId(); ?>"><img src="imagens/excluir.png" /></a></td>
  </tr>
  <?php } ?> 
</table>

</body>
</html>
<?php }else if(count($_POST) == 2){
	$control->alterar();	
     }else if(count($_POST) == 1){
	$control->excluir();	
     } ?>